package com.ruoyi.hxf.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 评论管理对象 f_advice
 *
 * @author hxf
 * @date 2023-1-23
 */
@Data
@TableName("f_comment")
public class Comment extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 编号(id)
     */
    @TableId(value = "comment_id")
    private Long commentId;
    /**
     * 帖子id
     */
    private Long topicId;

    /**
     * 被评论的用户id
     */
    private Long commentableId;

    private Long commentSearchId;

    /**
     * 评论的内容
     */
    @NotBlank(message = "帖子标题不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(min = 0, max = 400, message = "帖子内容不能超过400个字")
    private String commentContent;

    /**
     * 点赞次数
     */
    private Integer commentLikes;
    /**
     * 是否删除(0不显示，1显示)
     */
    private String isDelete;


    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private SysUser sysUser;

    @TableField(exist = false)
    private String TopicCollection;
}
